#include "header.h"
using namespace std;

ofstream debugfile;
game world;
gem gemDB[100];
monster monDB[100];
void init()
{
  debugfile.open("debug.txt");
  srand(time(0));
  monsterDBInit();
  gemDBInit();
  
  //Sets inventory
  gemCopy(gemDB[0],world.player.inventory[0]);
  gemCopy(gemDB[0],world.player.inventory[1]);
  gemCopy(gemDB[1],world.player.inventory[2]);
  gemCopy(gemDB[2],world.player.inventory[3]);
  gemCopy(gemDB[3],world.player.inventory[4]);
  
  world.currentboard=0;
  world.maps[world.currentboard].make();
  
  world.quit = false;
  world.playing = true;
  
  world.maps[world.currentboard].updateRect(room(0,0,80,25));
  world.maps[world.currentboard].centerCamera();
  
  
  
  
}

void deinit()
{
  debugfile.close();
}



int main(int argc, char *argv[])
{
  init();
  
  //Call a start draw menu function here
  while (!world.quit)
  {
    
    while (world.playing)
    {
      world.movementThink(world.getMoveInput());
    }
    
  }
  
  deinit();
  return 0;
}


